home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / appkit / Font.h < prev    next >
Text File  |  1992-09-11  |  4KB  |  117 lines

  1. /*
  2.     Font.h
  3.     Application Kit, Release 2.1J
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #ifndef FONT_H
  8. #define FONT_H
  9.  
  10. #import <objc/Object.h>
  11. #import <objc/hashtable.h>
  12. #import "afm.h"
  13.  
  14. #define NX_IDENTITYMATRIX ((float *) 0)
  15. #define NX_FLIPPEDMATRIX  ((float *) -1)
  16.  
  17. /* 
  18.  * Figure is also known as non-breaking space.
  19.  * NX_EMSPACE, NX_ENSPACE and NX_THINSPACE have been removed as part of
  20.  * the switch to the NextStep encoding.
  21.  */
  22.  
  23. #define NX_FIGSPACE    ((unsigned short)0x80)
  24.  
  25. typedef struct _NXFaceInfo {
  26.     NXFontMetrics      *fontMetrics;        /* Information from afm file */
  27.     int                 flags;            /* Which font info is present */
  28.     struct _fontFlags {                /* Keep track of font usage
  29.                          * for Conforming PS comments */
  30.     unsigned int        usedInDoc:1;    /* has font been used in doc? */
  31.     unsigned int        usedInPage:1;   /* has font been used in page? */
  32.     unsigned int        usedInSheet:1;  /* has font been used in sheet? */
  33.     unsigned int        _PADDING:13;
  34.     }                   fontFlags;
  35.     struct _NXFaceInfo *nextFInfo;        /* next faceInfo in the list */
  36. } NXFaceInfo;
  37.  
  38. @interface Font : Object
  39. {
  40.     NXAtom              name;
  41.     float               size;
  42.     int                 style;
  43.     float              *matrix;
  44.     int                 fontNum;
  45.     NXFaceInfo         *faceInfo;
  46.     id                  otherFont;
  47.     struct _fFlags {
  48. #ifdef __BIG_ENDIAN__
  49.       /* the following two instance variables are no longer part of the API */
  50.     unsigned int        usedByWS:1;
  51.     unsigned int        usedByPrinter:1;
  52.     unsigned int        isScreenFont:1;
  53.     unsigned int        _systemFontType:4;
  54.     unsigned int        _RESERVED:6;
  55.     unsigned int        _matrixIsIdentity:1;
  56.     unsigned int        _matrixIsFlipped:1;
  57.     unsigned int        _hasStyle:1;
  58. #else
  59.     unsigned int        _hasStyle:1;
  60.     unsigned int        _matrixIsFlipped:1;
  61.     unsigned int        _matrixIsIdentity:1;
  62.     unsigned int        _RESERVED:6;
  63.     unsigned int        _systemFontType:4;
  64.     unsigned int        isScreenFont:1;
  65.       /* the following two instance variables are no longer part of the API */
  66.     unsigned int        usedByPrinter:1;
  67.     unsigned int        usedByWS:1;
  68. #endif
  69.     }                   fFlags;
  70.     unsigned short      _reservedFont2;
  71.     unsigned int        _reservedFont3;
  72. }
  73.  
  74. + initialize;
  75. + allocFromZone:(NXZone *)zone;
  76. + newFont:(const char *)fontName size:(float)fontSize style:(int)fontStyle matrix:(const float *)fontMatrix;
  77. + newFont:(const char *)fontName size:(float)fontSize;
  78. + newFont:(const char *)fontName size:(float)fontSize matrix:(const float *)fontMatrix;
  79. + useFont:(const char *)fontName;
  80.  
  81. + userFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  82. + userFixedPitchFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  83. + systemFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  84. + boldSystemFontOfSize:(float)fontSize matrix:(const float *)fontMatrix;
  85. + setUserFont:(Font *)aFont;
  86. + setUserFixedPitchFont:(Font *)aFont;
  87.  
  88. - awake;
  89. - free;
  90. - (float)pointSize;
  91. - (const char *)name;
  92. - (const char *)familyName;
  93. - (const char *)displayName;
  94. - (int)fontNum;
  95. - (int)style;
  96. - setStyle:(int)aStyle;
  97. - (const float *)matrix;
  98. - (NXFontMetrics *)metrics;
  99. - (NXFontMetrics *)readMetrics:(int)flags;
  100. - (BOOL)hasMatrix;
  101. - set;
  102. - (float)getWidthOf:(const char *)string;
  103. - screenFont;
  104. - finishUnarchiving;
  105. - write:(NXTypedStream *)stream;
  106. - read:(NXTypedStream *)stream;
  107.  
  108. #ifdef KANJI
  109. - (int)mappingScheme;
  110. - (BOOL)isBaseFont;
  111. - (char *)characterSet;
  112. #endif KANJI
  113.  
  114. @end
  115.  
  116. #endif FONT_H
  117.